package org.hxyjs.dao.impl;

import org.hxyjs.dao.ActivitydetailsrecordDao;
import org.hxyjs.entity.Activitydetailsrecord;
import org.hxyjs.mapper.ActivitydetailsrecordMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("activitydetailsrecordDao")//一般实现类不会直接生成默认对象名 而是使用 接口的默认对象名
public class ActivitydetailsrecordDaoImpl implements ActivitydetailsrecordDao {
    @Resource //autowired 会装配能够直接扫描到的对象  resource spring容器运行的时候才找到需要的对象  注入
    private ActivitydetailsrecordMapper activitydetailsrecordMapper;
    public List<Activitydetailsrecord>  getAllActivitydetailsrecords() throws Exception{
        return activitydetailsrecordMapper.selectByExample(null);
    }

    @Override
    public Integer deleteActivitydetailsrecordByADRno(String adrno)  throws Exception{
        return activitydetailsrecordMapper.deleteByPrimaryKey(adrno);
    }

    @Override
    public Integer updateActivitydetailsrecordByADRno(Activitydetailsrecord activitydetailsrecord)  throws Exception{
        return activitydetailsrecordMapper.updateByPrimaryKey(activitydetailsrecord);
    }

    @Override
    public Integer addActivitydetailsrecord(Activitydetailsrecord activitydetailsrecord)  throws Exception{
        return activitydetailsrecordMapper.insertSelective(activitydetailsrecord);
    }

}
